package com.maisuiit.factory.schemes02.factory;

import com.maisuiit.factory.schemes02.service.IFreeGoods;
import com.maisuiit.factory.schemes02.service.impl.DiscountServiceImpl;
import com.maisuiit.factory.schemes02.service.impl.SmallGiftServiceImpl;
import com.maisuiit.factory.schemes02.service.impl.YouKuMemberServiceImpl;

/**
 * 具体工厂: 生成免费商品
 * @author: zhangcc
 * @date: 2024/02/20
 */
public class FreeGoodsFactory {

    public static IFreeGoods getInstance(Integer awardType){

        IFreeGoods iFreeGoods = null;

        if(awardType == 1){  //打折券
            iFreeGoods = new DiscountServiceImpl();
        }else if(awardType == 2){ //优酷会员
            iFreeGoods = new YouKuMemberServiceImpl();
        }else if(awardType == 3){ //小礼品
            iFreeGoods = new SmallGiftServiceImpl();
        }
        return iFreeGoods;
    }
}
